Import
Usage
Return Type: UseQueryResult<LifiSwapQuote>
The hook returns all properties from React Query’s UseQueryResult with swap quote data. Here’s the detailed structure of the swapQuote.
Properties
data
SwapQuote | undefined
The swap quote object containing:
currencyAddress: Address of the currency to be swappedcurrencyBalance: Balance of the currency in the user’s walletprice: The current price for the swapmaxPrice: Maximum price allowed for the swap (includes slippage)to: The target contract address that handles the swaptransactionData: Encoded transaction data for executing the swaptransactionValue: The value to be sent with the transaction (for native tokens)approveData: Encoded approval transaction data (if includeApprove is true and needed)amount: The amount of currency to be receivedamountMin: The minimum amount to be received after slippage
isLoading
boolean
Loading state for the data fetch.
isError
boolean
Error state indicating if the query failed.
error
Error | null
Any error that occurred during data fetching.
Parameters
The hook accepts two parameters:args: GetLifiSwapQuoteArgs
Note: You must provide either
fromTokenAmount or toTokenAmount, but not both.